<script setup lang='ts'>

interface Props {
  list: Array<any>
}

withDefaults(defineProps<Props>(), {})

function showDetail(data: ICasinoBetRecordItem) {
  // openBetSlipDialog({ type: 'casino', data })
}
function openCasinoGame(data: ICasinoBetRecordItem) {
  // const { game_code, platform_id, platform_name, game_name, game_class, game_type, id } = data
  // const r = Math.random().toString(36).slice(-10)
  // // 原创游戏
  // if (game_class === EnumGlobalGameType.original)
  //   return push(`/casino/original-game/${game_name.toLowerCase()}`)

  // let vid = +platform_id
  // if (EnumCasinoPidToVid[+platform_id])
  //   vid = EnumCasinoPidToVid[+platform_id]

  // push(`/games/${id || r}?name=${game_name}&pn=${platform_name}&vid=${vid}&game_id=${game_code}&game_class=${game_class}&pid=${platform_id}${game_type ? `&type=${game_type}` : ''}`)
}
</script>

<template>
  <div class="rounded overflow-hidden  mt-4">
    <div class="flex justify-between bg-[#323738] text-center font-semibold">
      <div class="flex-1 py-3 text-left px-4">游戏</div>
      <div class="flex-1 py-3 ">投注额</div>
      <div class="flex-1 py-3 text-right px-4">支付额</div>
    </div>
    <div v-for="item in list" @click="showDetail(item)"
      class="flex justify-between bg-[#323738] text-center font-semibold even:bg-[#3A4142] ">
      <div class="flex-1 py-3 text-left px-4">{{ item.game_name }}</div>
      <div class="flex-1 py-3 text-[#B3BEC1]">
        <BaseAmount :cur="getCurrencyConfigByCode(item.currency_id)?.name" :amount="item.bet_amount"
          style="--tg-base-amount-font-size:0.75rem;" :icon="false" />
      </div>
      <div class="flex-1 py-3 px-4 text-right text-[#B3BEC1]">
        <BaseAmount :cur="getCurrencyConfigByCode(item.currency_id)?.name" symbol :amount="item.settle_amount"
          icon-position="back" prefix positive-color="#24EE89" negative-color="#B3BEC1"
          style="--tg-base-amount-width:2rem;--tg-base-amount-font-size:0.75rem;" />
      </div>
    </div>
  </div>
</template>



<style lang='scss' scoped></style>
